import { DB_CONFIG } from '#config'
import Mysql from 'node-mysql-promise'

const mysqlPromise = Mysql.createConnection(DB_CONFIG)

export const TABLE = {
  USER: 'USER',
}

export const db = {
  table(tableName) {
    return mysqlPromise.table(tableName)
  },
  query(sql, parse) {
    return mysqlPromise.query(sql, parse)
  },
  execute(sql, parse) {
    return mysqlPromise.execute(sql, parse)
  },
}
